package demo.TestConterller;



import java.util.List;
import java.util.Properties;

import com.jfinal.core.Controller;

import demo.TestModel.Users;

public class TestLogin extends Controller {
	public void index(){
		render("login.jsp");
	}
	public void zhuce(){
		render("index.html");
	}
	public void login(){
		//Properties system = System.getProperties();
		List<Users> list = Users.dao.find("SELECT * FROM users");
		if (list.size()>0) {
			setAttr("list",list);
			
			//setAttr("system", system);
			renderJsp("user.jsp");
		}else {
			System.out.println("登录失败");
		}
	}
	public void save(){
		getModel(Users.class).save();
		
		//System.out.println(string2);
		//new Users().set("user", "小明").set("password",123).save();
		renderJsp("login.jsp");
	}
}
